package com.bw.goods.mvvm.bind;

import androidx.databinding.BindingAdapter;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;

public
/**
 * @author Lishaohe
 * @description:
 * @date :2021/10/17 0017 下午 7:25
 *
 */
class CategoryBind {

    @BindingAdapter(value = {"categoryadapter"})

    public static void bindcategory(
            RecyclerView recyclerView,
            BaseQuickAdapter adapter
    ){
        LinearLayoutManager manager = new LinearLayoutManager(recyclerView.getContext());
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter(adapter);

    }

    @BindingAdapter(value = {"rightcategory"})
    public static void bindrightcategory(
            RecyclerView recyclerView,
            BaseQuickAdapter adapter
    ){
        GridLayoutManager manager = new GridLayoutManager(recyclerView.getContext(), 2);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter(adapter);

    }
}
